import { getLodop } from '@/utils/lodop' //这块就是引用的上面一大坨暴露出来的方法喽

const PrintAccount = (strHtml,type) => {
    //调用打印对象
    LODOP = getLodop()
    //打印页面配置
    // LODOP.SET_PRINT_MODE("PRINT_PAGE_PERCENT","Full-Page");
    // LODOP.SET_PRINT_PAGESIZE(1, '7.6cm', '13cm')
    //LODOP.SET_PRINT_MODE("PRINT_DUPLEX",2)
    if(type==1){
      LODOP.SET_PRINT_MODE("PRINT_PAGE_PERCENT","Full-Page");
      LODOP.SET_PRINT_PAGESIZE(1, '7.6cm', '13cm')
    }
    if(type==2){
      LODOP.SET_PRINT_PAGESIZE(1, '0', '0','A4')
    }
      
     // 

    //内容
    strHtml.forEach((e,i) => {
      LODOP.NewPage();
      LODOP.ADD_PRINT_HTM(0,0,"100%","100%",e);
    });
    //LODOP.ADD_PRINT_HTM(0,0,"100%","100%",strHtml);
    //LODOP.SET_PRINT_STYLEA(0, 'FontSize', 15)
    //LODOP.ADD_PRINT_BARCODE(26, 15, 170, 147, 'QRCode', 'testetetete')


}

export { PrintAccount }
